設定Pipeline的方式有兩種一種是透過介面管理設定,另一種就只能進機器編輯Pipeline設定檔
透過Kibana選擇左下角的Stack Management進去之後選擇
Logstash Pipelines 然後再按 Create Pipelines
按下Create and deploy按鈕之後,應該可以在logstash log看見相關訊息
編輯 /etc/logstash/pipelines.yml 基本上跟介面差不多了
- pipeline.id: dev
path.config: "/etc/logstash/dev_conf.d/pipeline.conf"
pipeline.workers: 3
pipeline.batch.delay: 5
- pipeline.id: qa
path.config: "/etc/logstash/qa_conf.d/pipeline.conf"
queue.type: persisted
pipeline.batch.size 200
再編輯 /etc/logstash/dev_conf.d/pipeline.conf
input {
redis {
data_type => "list"
key => "dev"
host => "10.102.0.16"
port => "6379"
db => 0
id => "elk-redis-dev-1"
}
}
filter {
json {
source => "message"
target => "content"
}
}
output {
elasticsearch {
index => "%{[kubernetes][namespace]}-%{[kubernetes][container][name]}-@-%{+YYYY.MM.dd}"
hosts => ["10.102.0.15:9200", "10.102.0.17:9200"]
}
}